import request from '@/utils/request';

export default {
  //分页课程查询
  getCourseList(page, limit, courseInfo) {
    return request({
      url: `/eduservice/coursefront/getFrontCourseList/${page}/${limit}`,
      method: 'post',
      data: courseInfo
    })
  },
  //查询所有分类的方法
  getAllSubject() {
    return request({
      url: `/eduservice/subject/getAllSubject`,
      method: 'get'
    })
  },
  //课程详情的方法
  getCourseInfo(courseId) {
    return request({
      url: `/eduservice/coursefront/getFrontCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  //收藏方法
  hitCollect(data) {
    return request({
      url: `/eduservice/edu-course-collect/hitCollect`,
      method: 'post',
      data: data
    })
  },
  //取消收藏
  cancelCollect(courseId, memberId) {
    return request({
      url: `/eduservice/edu-course-collect/cancelCollect/${courseId}/${memberId}`,
      method: 'delete'
    })
  },
  //是否收藏
  isCollect(courseId, memberId) {
    return request({
      url: `/eduservice/edu-course-collect/isCollect/${courseId}/${memberId}`,
      method: 'get'
    })
  },
}